<template>
  <view class="regimen-plan">
    <view class="content">{{ regimentPlan.summary }}</view>
    <view class="regimen-plan-list">
      <plain-card v-for="(plan, index) in regimentPlan.items" :key="index">
        <template v-slot:icon>
          <view class="icon-regiment-plan"></view>
        </template>
        <template v-slot:title>
          <text>{{ plan.title }}</text>
        </template>
        <template v-slot:content>
          <view>{{ plan.content }}</view>
        </template>
      </plain-card>
    </view>
    <button class="button-plain-purple" @tap="navigateToRegimen">
      商城购买
    </button>
  </view>
</template>

<script>
import Taro from "@tarojs/taro";
import PlainCard from "../components/plain-card.vue";
export default {
  components: {
    plainCard: PlainCard
  },
  props: ["regimentPlan"],
  data() {
    return {
      // regimentPlan: [
      //   {
      //     title: "银耳玉竹润肺汤",
      //     content: "清肺润燥，健脾祛痰。"
      //   },
      //   {
      //     title: "芡实陈皮汤",
      //     content: "健脾理气，和胃祛湿。"
      //   },
      //   {
      //     title: "五指毛桃健脾汤",
      //     content: "健脾补肺，行气利湿，舒筋活络。"
      //   }
      // ]
    };
  },
  methods: {
    navigateToRegimen() {
      // 中医养生tab id
      const reginmenId = 2;
      Taro.navigateTo({
        url: `/pages/sales/category/index?category=${reginmenId}`
      });
    }
  }
};
</script>

<style lang="less">
@import "./index.less";
</style>
